#define __display_c

#include    "includeAll.h"

code const uint8_t displayFonts[10] =
{
    0x3f,  /*0*/
    0x06,  /*1*/
    0x5b,  /*2*/
    0x4f,  /*3*/
    0x66,  /*4*/
    0x6d,  /*5*/
    0x7d,  /*6*/
    0x07,  /*7*/
    0x7f,  /*8*/
    0x6f,  /*9*/
};

void DisplayScan(void)
{

   displayBuffer[0] =0x00;
   displayBuffer[1] =0x00;
   displayBuffer[2] =0x00;
   displayBuffer[3] =0x00;
   displayBuffer[4] =0x00;
   displayBuffer[5] =0x00;
   displayBuffer[6] =0x00;
   displayBuffer[7] =0x00;
   displayBuffer[8] =0x00;
   displayBuffer[9] =0x00;
   displayBuffer[10]=0x00;
   displayBuffer[11]=0x00;
   displayBuffer[12]=0x00;
   displayBuffer[13]=0x00;
   displayBuffer[14]=0x00;
   displayBuffer[15]=0x00;
   
	
	
	if(bSecFlash500ms)
	{
		clockFlagOn;
	}
	
    curTempFlagOn;
   
    d_seg=displayFonts[curTemp/10];
//d_seg=displayFonts[a/10];
    if(f_seg_a)    {set_led_1a;  set_led_2a;}
    if(f_seg_b)    {set_led_1b;  set_led_2b;}
    if(f_seg_c)    {set_led_1c;  set_led_2c;}
    if(f_seg_d)    {set_led_1d;  set_led_2d;}
    if(f_seg_e)    {set_led_1e;  set_led_2e;}
    if(f_seg_f)    {set_led_1f;  set_led_2f;}
    if(f_seg_g)    {set_led_1g;  set_led_2g;}

	//	d_seg=displayFonts[a%10];
   d_seg=displayFonts[curTemp%10];
    if(f_seg_a)    {set_led_3a;  set_led_4a;}
    if(f_seg_b)    {set_led_3b;  set_led_4b;}
    if(f_seg_c)    {set_led_3c;  set_led_4c;}
    if(f_seg_d)    {set_led_3d;  set_led_4d;}
    if(f_seg_e)    {set_led_3e;  set_led_4e;}
    if(f_seg_f)    {set_led_3f;  set_led_4f;}
    if(f_seg_g)    {set_led_3g;  set_led_4g;}
	
    if(bPowerOnOff)
    {
        
        setTempChar1On;
        setTempChar2On;
        setTempFlagOn;
        d_seg=displayFonts[setCurTemp/10];
        if(f_seg_a)    set_led_5a;
        if(f_seg_b)    set_led_5b;
        if(f_seg_c)    set_led_5c;
        if(f_seg_d)    set_led_5d;
        if(f_seg_e)    set_led_5e;
        if(f_seg_f)    set_led_5f;
        if(f_seg_g)    set_led_5g;

        d_seg=displayFonts[setCurTemp%10];
        if(f_seg_a)    set_led_6a;
        if(f_seg_b)    set_led_6b;
        if(f_seg_c)    set_led_6c;
        if(f_seg_d)    set_led_6d;
        if(f_seg_e)    set_led_6e;
        if(f_seg_f)    set_led_6f;
        if(f_seg_g)    set_led_6g;

        gearCharOn;
        d_seg=displayFonts[gear];
        if(f_seg_a)    set_led_7a;
        if(f_seg_b)    set_led_7b;
        if(f_seg_c)    set_led_7c;
        if(f_seg_d)    set_led_7d;
        if(f_seg_e)    set_led_7e;
        if(f_seg_f)    set_led_7f;
        if(f_seg_g)    set_led_7g;

			
				
        if((function==1)&&(bShan1s==0))
        {
            lowWorkCharOn;
            lowWorkTempOn;
         
        }
		
		
        else if((function==2)&&(bShan1s==0))
        {
            highWorkCharOn;
            highWorkTempOn;

        }
		
		else if((flashSetFunction>0)&&(function==3)&&(setFunctionNum==2))
		{
			lowWorkCharOn;
            lowWorkTempOn;
			highWorkCharOn;
            highWorkTempOn;
		}
       
       
		
		
		
			
		
        if((bSaveTemp==0)&&(bOrderOpen==0))
        {
            heatCharOn;
			if(curTemp<=50)
			{
				 if(bSecFlash500ms)
				{
					blueLedOn;
				}
		
			}
			else if((curTemp<=60)&&(curTemp>50))
			{
				if(bSecFlash500ms)
				{
					blueLedOn;
					redLedOn;
				}
				
			}
			else if(curTemp>60)
			{
				if(bSecFlash500ms)
				{
					redLedOn;
				}
				
			}
        }
        else
        {
            saveTempCharOn;
            if(curTemp<=50)
			{
				
					blueLedOn;
			
			}
			else if((curTemp<=60)&&(curTemp>50))
			{
				
					blueLedOn;
					redLedOn;
				
			}
			else if(curTemp>60)
			{
				
					redLedOn;
				
			}
        } 
		

    }

   
	 clockCharOn; 
	 
	switch(setClockNum)
    {
    case 0:
    case 1:
    case 2:

        clockHourH=mainClockHour/10;
        clockHourL=mainClockHour%10;
        clockMinH =mainClockMin/10;
        clockMinL =mainClockMin%10;
	
        orderCloseOff;
        orderOpenOff;
        
        break;


    case 3:
    case 4: 
		clockHourH =orderClockOpenHour/10;
        clockHourL = orderClockOpenHour%10;
        clockMinH =  orderClockOpenMin/10;
        clockMinL =  orderClockOpenMin%10;
        orderCloseOff;
        orderOpenOn;
        clockCharOff;
        break;


break;
    case 5:
    case 6:
	    clockHourH	=orderClockCloseHour/10;
        clockHourL	=orderClockCloseHour%10;
        clockMinH 	=orderClockCloseMin/10;
        clockMinL =	orderClockCloseMin%10;
        orderCloseOn;
        orderOpenOff;
        clockCharOff;
        break;
	
    }
    d_seg=displayFonts[clockHourH];
    if(f_seg_a)    set_led_8a;
    if(f_seg_b)    set_led_8b;
    if(f_seg_c)    set_led_8c;
    if(f_seg_d)    set_led_8d;
    if(f_seg_e)    set_led_8e;
    if(f_seg_f)    set_led_8f;
    if(f_seg_g)    set_led_8g;

    d_seg=displayFonts[clockHourL];
    if(f_seg_a)    set_led_9a;
    if(f_seg_b)    set_led_9b;
    if(f_seg_c)    set_led_9c;
    if(f_seg_d)    set_led_9d;
    if(f_seg_e)    set_led_9e;
    if(f_seg_f)     set_led_9f;
    if(f_seg_g)    set_led_9g;


    d_seg=displayFonts[clockMinH];
    if(f_seg_a)    set_led_10a;
    if(f_seg_b)    set_led_10b;
    if(f_seg_c)    set_led_10c;
    if(f_seg_d)    set_led_10d;
    if(f_seg_e)    set_led_10e;
    if(f_seg_f)     set_led_10f;
    if(f_seg_g)    set_led_10g;

    d_seg=displayFonts[clockMinL];
    if(f_seg_a)    set_led_11a;
    if(f_seg_b)    set_led_11b;
    if(f_seg_c)    set_led_11c;
    if(f_seg_d)    set_led_11d;
    if(f_seg_e)    set_led_11e;
    if(f_seg_f)     set_led_11f;
    if(f_seg_g)    set_led_11g;

	if(flashSetClock==0)
	{
		
	if((flashSetYuYUe>0)&&(bSecFlash500ms==1))
	{
			
				 if(setYuYueNum==1)
				{
					orderOpenOn;
				}
				else if(setYuYueNum==2)
				{
				orderCloseOn;
				}
	
	}
	
	if(flashSetYuYUe==0)
	{
			if(bOrderOpen)
		{
			orderOpenOn;
		}
	
		if(bOrderClose)
		{
			orderCloseOn;
		}
	}
	}
	
			
	if(P_BengJDQ)
	{
		setZengYa1On;
		setZengYa2On;
	}

}